using System;using System.Data;using System.Data.SqlClient;using System.Collections.Generic;namespace MyWeb.Data{	public class LanguageDAL : SqlDataProvider	{		#region[Language_GetById]		public List<Language> Language_GetById(string Id)		{			List<Data.Language> list = new List<Data.Language>();			using (SqlCommand dbCmd = new SqlCommand("sp_Language_GetById", GetConnection()))			{				Data.Language obj = new Data.Language();				dbCmd.CommandType = CommandType.StoredProcedure;				dbCmd.Parameters.Add(new SqlParameter("@Id", Id));				SqlDataReader dr = dbCmd.ExecuteReader();				if (dr.HasRows)				{					while (dr.Read())					{						list.Add(obj.LanguageIDataReader(dr));					}
                }
                dr.Close();
                //conn.Close();			}			return list;		}		#endregion		#region[Language_GetByTop]		public List<Language> Language_GetByTop(string Top, string Where, string Order)		{			List<Data.Language> list = new List<Data.Language>();			using (SqlCommand dbCmd = new SqlCommand("sp_Language_GetByTop", GetConnection()))			{				Data.Language obj = new Data.Language();				dbCmd.CommandType = CommandType.StoredProcedure;				dbCmd.Parameters.Add(new SqlParameter("@Top", Top));				dbCmd.Parameters.Add(new SqlParameter("@Where", Where));				dbCmd.Parameters.Add(new SqlParameter("@Order", Order));				SqlDataReader dr = dbCmd.ExecuteReader();				if (dr.HasRows)				{					while (dr.Read())					{						list.Add(obj.LanguageIDataReader(dr));					}
                }
                dr.Close();
                //conn.Close();			}			return list;		}		#endregion		#region[Language_GetByAll]		public List<Language> Language_GetByAll()		{			List<Data.Language> list = new List<Data.Language>();			using (SqlCommand dbCmd = new SqlCommand("sp_Language_GetByAll", GetConnection()))			{				Data.Language obj = new Data.Language();				dbCmd.CommandType = CommandType.StoredProcedure;				SqlDataReader dr = dbCmd.ExecuteReader();				if (dr.HasRows)				{					while (dr.Read())					{						list.Add(obj.LanguageIDataReader(dr));					}
                }
                dr.Close();
                //conn.Close();			}			return list;		}		#endregion		#region[Language_Paging]		public List<Language> Language_Paging(string CurentPage, string PageSize)		{			List<Data.Language> list = new List<Data.Language>();			using (SqlCommand dbCmd = new SqlCommand("sp_Language_Paging", GetConnection()))			{				Data.Language obj = new Data.Language();				dbCmd.CommandType = CommandType.StoredProcedure;				dbCmd.Parameters.Add(new SqlParameter("@CurentPage", CurentPage));				dbCmd.Parameters.Add(new SqlParameter("@PageSize", PageSize));				SqlDataReader dr = dbCmd.ExecuteReader();				if (dr.HasRows)				{					while (dr.Read())					{						list.Add(obj.LanguageIDataReader(dr));					}
                }
                dr.Close();
                //conn.Close();			}		return list;		}		#endregion		#region[Language_Insert]		public bool Language_Insert(Language data)		{			using (SqlCommand dbCmd = new SqlCommand("sp_Language_Insert", GetConnection()))			{				dbCmd.CommandType = CommandType.StoredProcedure;				dbCmd.Parameters.Add(new SqlParameter("@Id", data.Id));				dbCmd.Parameters.Add(new SqlParameter("@Name", data.Name));				dbCmd.Parameters.Add(new SqlParameter("@Folder", data.Folder));				dbCmd.Parameters.Add(new SqlParameter("@Default", data.Default));				dbCmd.Parameters.Add(new SqlParameter("@Images", data.Images));				dbCmd.Parameters.Add(new SqlParameter("@Active", data.Active));				dbCmd.ExecuteNonQuery();			}			//Clear cache			System.Web.HttpContext.Current.Cache.Remove("Language");			return true;		}		#endregion		#region[Language_Update]		public bool Language_Update(Language data)		{			using (SqlCommand dbCmd = new SqlCommand("sp_Language_Update", GetConnection()))			{				dbCmd.CommandType = CommandType.StoredProcedure;				dbCmd.Parameters.Add(new SqlParameter("@Id", data.Id));				dbCmd.Parameters.Add(new SqlParameter("@Name", data.Name));				dbCmd.Parameters.Add(new SqlParameter("@Folder", data.Folder));				dbCmd.Parameters.Add(new SqlParameter("@Default", data.Default));				dbCmd.Parameters.Add(new SqlParameter("@Images", data.Images));				dbCmd.Parameters.Add(new SqlParameter("@Active", data.Active));				dbCmd.ExecuteNonQuery();			}			//Clear cache			System.Web.HttpContext.Current.Cache.Remove("Language");			return true;		}		#endregion		#region[Language_Delete]		public bool Language_Delete(string Id)		{			using (SqlCommand dbCmd = new SqlCommand("sp_Language_Delete", GetConnection()))			{				dbCmd.CommandType = CommandType.StoredProcedure;				dbCmd.Parameters.Add(new SqlParameter("@Id", Id));				dbCmd.ExecuteNonQuery();			}			//Clear cache			System.Web.HttpContext.Current.Cache.Remove("Language");			return true;		}		#endregion			}}